<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>onload</title>
</head>
<body onload="来吧()" onUnload="outtimes()" onresize="aks()">
<script>
function 来吧() {
    let i=new Date();
    document.write(`当前时间是：`+i);
}
let begintime=new Date();
function outtimes() {
    endtime=new Date();
    minuss=endtime.getMinutes() - begintime.getMinutes();
    seconds=endtime.getSeconds() - begintime.getSeconds();
    time= seconds + (minuss*60)
    console.log(time)
    document.write(`你在本页面共停留了：`+time+`分钟`)
}
function aks() {
    document.write(`你动了一下网页`);
    
}
</script>

</body>
</html>